<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/8/19
 * Time: 18:36
 */
class 四舍五入保留几位小格式化数字
{

}
/** 1.number_format */
$number = 1234.56789;
$nombre_format_francais = number_format($number, 2, ',', ' ');
$english_format_number = number_format($number, 2, '.', '');


/** 2.round */
$number = 1234.56789;
echo round($number ,2);


/** 3.sprintf */
$formatted = sprintf ("￥%01.2f。", $money);
echo $formatted;